// Copyright 2011 Jefferson Willian
// willmont7@gmail.com

#include <cstdio>
#include <vector>

#define MAX 400

using std::vector;

/* Verifica se o sistema esta conectado */
void isConnected_(vector<int> list[], bool blocked[], int forb, int curr, int n, int *total) {
  if (*total == n)
    return;

  int sz = static_cast<int>(list[curr].size());
  int process[MAX];

  process[0] = 1;
  blocked[curr] = true;

  /* Conecta todos ligados a curr que nao esteja relacionado com o intem retirado(forb) */
  for (int i = 0;i < sz;i++)
    if (list[curr][i] != forb && !blocked[list[curr][i]]) {
      blocked[list[curr][i]] = true;
      process[process[0]++] = list[curr][i];
      (*total)++;
    }

  if (*total == n)
    return;

  /* Todos que foram ligados fazem o mesmo processo */
  for (int i = 1;i < process[0];i++)
    isConnected_(list, blocked, forb, process[i], n, total);

  return;
}

bool isConnected(vector<int> list[], int forb, int n) {
  bool blocked[MAX];
  int total = 1;

  for (int i = 0;i < n;i++)
    blocked[i] = false;

  if (forb == 0)
    isConnected_(list, blocked, forb, 1, n-1, &total);
  else
    isConnected_(list, blocked, forb, 0, n-1, &total);

  if (total == n-1 || total == n)
    return true;
  return false;
}

int main() {
  int n, m;
  vector<int> list[MAX];
  bool none;
  int temp[2];
  int games = 1;

  while (scanf("%d%d", &n, &m) && (n != 0 || m != 0)) {
    for (int i = 0;i < n;i++)
      list[i].clear();

    for (int i = 0;i < m;i++) {
      scanf("%d%d", &temp[0], &temp[1]);
      temp[0]--;
      temp[1]--;
      list[temp[0]].push_back(temp[1]);
      list[temp[1]].push_back(temp[0]);
    }

    printf("Teste %d\n", games++);
    none = true;

    /* Verifica se para cada computador, se retirado interfere  */
    /* na ligacao do sistema                                    */
    for (int i = 0;i < n;i++)
      if (!isConnected(list, i, n)) {
        printf("%d ", i+1);
        none = false;
      }

    if (none)
      printf("nenhum");

    printf("\n\n");
  }

  return 0;
}
